#ifndef __UTILS__
#define __UTILS__

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>

#include "primitive.h"
#include "attribute.h"

#include "mesh.h"

#include "io.h"
#include "stdutils.h"

// void MarkBoundaryTriangles(STriangleMesh& tm, size_t id, const std::set<size_t>& mb);
void ExtractPatches(const Surface& surface, std::map<std::string, size_t>& mapPosition, std::vector<Vec4n>& position, std::vector< boost::multi_array<size_t, 2> >& element, std::vector< std::pair<Vec2n, Vec2n> >& domain, std::vector< std::pair<Knotvector, Knotvector> >& knotvector);
NurbsSurfaceMesh* GenerateSurface(const std::vector<Surface>& surface, bool useWeights = true);
NurbsSurfaceMesh* GenerateSurface(const Surface& surface, bool useWeights = true);

Curve Circle();
Surface PeriodicCylindricalSurface(const nfloat radius, const nfloat height, const size_t n, const size_t m, const size_t p, const size_t q);
Surface Torus();
Surface Square(size_t N, size_t M, nfloat a, nfloat b, size_t p, size_t q, bool identity);
Surface DiskPolar(nfloat scale);
std::vector<nfloat> DetermineParameters(const Knotvector& U, size_t n, size_t pu, nfloat uStart, nfloat uEnd, size_t samplesPatch);

std::string Filename(const std::string& str);
std::string GeneratePath(const std::string& strPrefix);
std::string FileExtension(const std::string& filename);

#include "mesh.h"


#endif //__UTILS__
